package com.alisls.shequtao.common.model.result;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 分页对象
 *
 * @author Ke Wang
 */
@Getter
@Setter
public class PageResult<E> implements Result, Serializable {

	private static final long serialVersionUID = -809660885012040887L;

	// 页码
    private Long currentPage;

    // 每页数据量
    private Long pageSize;

    /**
     * 页段 10
     */
    private Long[] pageSegments = {10L, 30L, 50L, 70L, 100L};

    // 总页数
    private Long totalPages;

    // 记录数
    private Long totalCount;

    // 记录数据
    private List<E> rows;

    /**
     * 无参构造函数
     */
    public PageResult() {
    }

    /**
     * 构造函数
     */
    public PageResult(Long currentPage, Long pageSize, Long totalPages, Long totalCount, List<E> rows) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalPages = totalPages;
        this.totalCount = totalCount;
        this.rows = rows;
    }

}
